// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 获取项目列表 */
export async function getProjectList(params: API.Project.ProjectParam) {
  return request('/api/project', {
    method: 'GET',
    params,
  });
}

/** 获取项目列表下拉框 */
export async function getProjectSelectList() {
  return request('/api/project/select', {
    method: 'GET',
  });
}

/** 新增项目 */
export async function addProject(data: API.Project.ProjectData) {
  return request('/api/project/add', {
    method: 'POST',
    data,
  });
}

/** 修改项目 */
export async function updateProject(data: API.Project.ProjectData) {
  return request('/api/project/update', {
    method: 'POST',
    data,
  });
}

/** 删除项目 */
export async function deleteProject(id: number) {
  return request('/api/project/delete', {
    method: 'DELETE',
    data: { id },
  });
}
